package walk;

import java.util.concurrent.atomic.AtomicInteger;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import comm.LOG;

public class chc2 extends Thread {

	private static AtomicInteger ai = new AtomicInteger(15000000);

	private static LOG log = new LOG("C:\\csuu\\walk.offset");

	public void run() {

		while (true) {
			int i = ai.getAndIncrement();

			if (i % 100 == 0) {
				log.info(i);
			}

			String url = "http://my.hupu.com/" + i + "";
			try {
				Connection c = Jsoup.connect(url);

				c.userAgent("Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0");
				c.header("Cookie", "	u=17112821%7Cbm1sMTg2%7C8c2d%7Ce50b2fe9e47a23f8973f3abee0733ebd%7Ce47a23f8973f3abe; ua=62072554; PHPSESSID=04c9500aff27dec9183d74fca35a694e");

				c.referrer("http://my.hupu.com/public/nba");
				Document doc = c.get();

				//Elements es = doc.getElementsContainingOwnText("上次登录");
				
				
				
				System.out.println(i+",");
				//sleep(300);

			} catch (Exception e) {
				System.out.println(e.getMessage());
			}
		}

	}

	public static void main(String[] args) {
		for (int i = 0; i < 3; i++) {
			new chc2().start();
		}
	}
}
